# #序列和索引的相关概念
# from time import process_time_ns
#
# num=['he','kk','aa','bb']
# print(num)
#
# num2={0:'aa',1:'bb',2:'cc'}
# #字典
# for key,value in num2.items():
#     print(key,value)
# #列表
# for index,item in enumerate(num):
#     print(index,item)
#
# num.append('heshuai')
# print(num)
#
# num.insert(2,'hekun')
# print(num)
#
# num_new=num.pop(2)
# print(num)
# print(num_new)
#
# num.remove('aa')
# print(num)
# num.reverse()
# print(num)
#
# heshuai=num.copy()
# new=num
# print(heshuai)
#
# num.sort(key=None)
# print(num)
#
# new2=sorted(num,reverse=True)
# print(new2)

# lst=[88,89,90,98,0,99]
#
# new_lst=[]
# for index in range(len(lst)):
#     if str(lst[index]) != '0':
#         lst[index]='19'+str(lst[index])
#     else:
#         lst[index]='200'+str(lst[index])
#
# print(lst)


# num=[]
# for i in range(1,6):
#     source=input('请录入第{0}个商品的信息：'.format(i))
#     num.append(source)
# #print(num)
#
# for i in num:
#     print(i)
# for i in range(5):
#     new_input=input('请输入要添加的商品:')
#     if new_input in num:
#         print('添加购物车成功！')
#     else:
#         print('不存在')
dict_ticket={
    'G1569':['北京南-天津南','18:06','18:39','00:33'],
    'G1567':['北京南-天津南','18:15','18:49','00:34'],
    'G8917':['北京南-天津西','18:20','18:19',"00:59"],
    'G203':['北京南-天津南','18:35','19:09','00:34']
}
print('本次车列   出发站-到达站   出发时间   到达时间   历时时长')

# for key,value in dict_ticket.items():
#     print(key,value)

num=input('请输入要购买的车次：')
info=dict_ticket.get(num,'不存在')

if info!='不存在':
    read=input('请输入乘车人的名字，如果多人，可以用逗号隔开：')
    print(f'你已购买{num},{read},请取票')
else:
    print('你输入的车次不存在，请重新输入')


